<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>修改用户信息</title>
	
</head>
<body>
 <?php
   
   $row = $data['user']; 
   var_dump($row);
    $uid = $row['uid']; 
   $uname = $row['uname'];
   $gender = $row['gender'];
   $birthdate = $row['birthdate'];
   $hobby = $row['hobby'];
   $degree = $row['degree'];
   $intro = $row['intro'];
   $pic = 'images/'.$row['pic'];	  
	//将查询结果显示在表单中
 ?>
<form method=post action="index1.php?c=user&m=updateuser" enctype="multipart/form-data" >
<table border="1">
<tr>
  <td width="20%">id</td>
  <td width="80%">
  <input type="hidden" name="uid" value=<?php  echo $uid;  ?>>  
  </td>
</tr>
<tr>
<td>姓名：</td>
  <td><input type="text" name="uname" size=30  value=<?php  echo $uname;  ?>></td>
</tr>
<tr>
<td>密码：</td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td>性别：</td>
<td>
<input type="radio" name="gender"   value=0 <?php  if(!$gender) echo 'checked';  ?>>男
<input type="radio" name="gender"   value=1<?php  if($gender) echo 'checked';  ?>>女
</td>
</tr>
<tr>
<td>生日：</td>
<td><input type="date" name="birthdate" value=<?php  echo $birthdate;  ?>>
</td>
</tr>
<tr>
<td>爱好：</td>
<td>
<input type="checkbox" name="hobby[]" value="旅游"<?php  if(strstr($hobby,'旅游')) echo 'checked';  ?>>
<input type="checkbox" name="hobby[]" value="登山"  <?php  if(strstr($hobby,'登山')) echo 'checked';  ?>>
<input type="checkbox" name="hobby[]" value="健身"<?php  if(strstr($hobby,'健身')) echo 'checked';  ?>>
<input type="checkbox" name="hobby[]" value="上网"<?php  if(strstr($hobby,'上网')) echo 'checked';  ?>>
<input type="checkbox" name="hobby[]" value="游泳"<?php  if(strstr($hobby,'游泳')) echo 'checked';  ?>>
</td>
</tr>
<tr>
<td>学历：</td>
<td>
<select name="degree">
<option value="0">请选择</option>
<option value="1"<?php  if($degree=='1') echo 'selected';  ?>>高中</option>
<option value="2"<?php  if($degree=='1') echo 'selected';  ?>>大学</option>
<option value="3"<?php  if($degree=='1') echo 'selected';  ?>>研究生</option>
<option value="4"<?php  if($degree=='1') echo 'selected';  ?>>博士生</option>
</select>
</td>
</tr>
<tr>
<td>自我介绍</td>
<td>
<textarea name="intro"><?php  echo $intro;  ?>自我简介：</textarea>
</td>
</tr>
<tr>
<td>头像</td>
<td>
<img src='<?php  echo $pic; ?>' width=100 height=150>
  <input type="file" name="pic">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="提交">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>

</body>
</html>